package com.jueecy.mapper;

import com.jueecy.pojo.Goods;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface GoodsMapper {


    //添加商品
    Integer addGoods(Goods goods);

    //查询所有商品
    List<Goods> queryAllGoods();

    //查询购物清单
    List<Goods> queryShoppingCart(Integer user_id);

    //添加商品到购物车
    Integer addToShoppingCart(Integer user_id,Integer goods_id);

    //从购物车中删除某件商品
    Integer deleteFromShoppingCart(Integer user_id,Integer goods_id);

    //按类型查询商品
    List<Goods> findGoodsByType(Integer goods_type);

    //按照关键字查询商品
    List<Goods> searchGoodsByName(String keywords);

    //查询用户已经发布的商品
    List<Goods> alreadySell(Integer user_id);

    //删除已经发布的某件商品
    Integer deleteMyGoods(Integer user_id,Integer goods_id);

}
